<div class="form">
    <?php
    $formConfig['htmlOptions']['class'] = 'form-horizontal';
    $formConfig['htmlOptions']['role'] = 'form';
    ?>
    <?php $form = $this->beginWidget('ActiveForm', $formConfig); ?>

    <?php
    echo $form->alert(array($user, $address), array(
        'errorMessageHtmlOptions' => array('class' => 'alert alert-danger'),
        'flashHtmlOptions' => array('class' => 'alert alert-'),
    ));
    ?>

    <?php if (!$user->isNewRecord): ?>
        <div class="form-group">
            <?php echo $form->labelEx($user, 'id_', array('class' => 'col-sm-2 control-label')); ?>
            <div class="col-sm-2">
                <div class="form-control-static">
                    <?php echo $user->id; ?>
                </div>
            </div>
        </div>
    <?php endif; ?>

    <!--
    <div class="form-group">
    <?php echo $form->labelEx($user, 'accountId_', array('class' => 'col-sm-2 control-label')); ?>
        <div class="col-sm-5">
    <?php echo $form->dropDownList($user, 'accountId_', $user->accountOption, array('empty' => '', 'class' => 'form-control')); ?>
        </div>
    <?php //echo $form->error($user,'accountId_');  ?>
    </div>
    -->

    <div class="form-group">
        <?php echo $form->labelEx($user, 'userRole_', array('class' => 'col-sm-2 control-label')); ?>
        <div class="col-sm-2">
            <?php echo $form->dropDownList($user, 'userRole_', $user->adminRoleOption, array('class' => 'form-control')); ?>
        </div>
        <?php //echo $form->error($user,'userRole_'); ?>

        <?php echo $form->labelEx($user, 'status_', array('class' => 'col-sm-2 control-label')); ?>
        <div class="col-sm-2">
            <?php echo $form->dropDownList($user, 'status_', $user->statusOption, array('class' => 'form-control')); ?>
        </div>
        <?php //echo $form->error($user,'status_');  ?>
    </div>

    <div class="form-group">
        <?php echo $form->labelEx($user, 'language_', array('class' => 'col-sm-2 control-label')); ?>
        <div class="col-sm-2">
            <?php echo $form->dropDownList($user, 'language_', $user->languageOption, array('class' => 'form-control')); ?>
        </div>
        <?php //echo $form->error($user,'language_');  ?>
    </div>

    <hr />

    <div class="form-group">
        <?php echo $form->labelEx($user, 'image_', array('class' => 'col-sm-2 control-label')); ?>
        <div class="col-sm-2">
            <?php echo $form->avatarUpload($user, 'image_', array('class' => 'form-control')); ?>
        </div>
        <?php //echo $form->error($user, 'image_');  ?>
    </div>	

    <div class="form-group">
        <?php echo $form->labelEx($user, 'username_', array('class' => 'col-sm-2 control-label')); ?>
        <div class="col-sm-2">
            <?php echo $form->textField($user, 'username_', array('class' => 'form-control')); ?>
        </div>
        <?php //echo $form->error($user,'username_');  ?>
    </div>

    <div class="form-group">
        <?php echo $form->labelEx($user, 'firstName_', array('class' => 'col-sm-2 control-label')); ?>
        <div class="col-sm-2">
            <?php echo $form->textField($user, 'firstName_', array('class' => 'form-control')); ?>
        </div>
        <?php //echo $form->error($user,'firstName_'); ?>

        <?php echo $form->labelEx($user, 'lastName_', array('class' => 'col-sm-2 control-label')); ?>
        <div class="col-sm-2">
            <?php echo $form->textField($user, 'lastName_', array('class' => 'form-control')); ?>
        </div>
        <?php //echo $form->error($user,'lastName_');  ?>
    </div>

    <div class="form-group">
        <?php echo $form->labelEx($user, 'gender_', array('class' => 'col-sm-2 control-label')); ?>
        <div class="col-sm-2">
            <?php
            echo $form->radioButtonList($user, 'gender_', $user->genderOption, array(
                'template' => '{beginLabel}{input} <i class="fa fa-circle-o small"></i>{labelTitle}{endLabel}',
                'labelOptions' => array('class' => 'radio-inline'),
                'separator' => ''
            ));
            ?>
        </div>
        <?php //echo $form->error($user,'gender_'); ?>

        <?php echo $form->labelEx($user, 'dob_', array('class' => 'col-sm-2 control-label')); ?>
        <div class="col-sm-2">
            <?php $form->dateSelector($user, 'dob_', array('class' => 'form-control')); ?>
        </div>
        <?php //echo $form->error($user,'dob_'); ?>
    </div>

    <div class="form-group">
        <?php echo $form->labelEx($user, 'maritalStatus_', array('class' => 'col-sm-2 control-label')); ?>
        <div class="col-sm-2">
            <?php echo $form->dropDownList($user, 'maritalStatus_', $user->maritalStatusOption, array('class' => 'form-control')); ?>
        </div>
        <?php //echo $form->error($user,'maritalStatus_'); ?>

        <?php echo $form->labelEx($user, 'ethnic_', array('class' => 'col-sm-2 control-label')); ?>
        <div class="col-sm-2">
            <?php echo $form->dropDownList($user, 'ethnic_', $user->ethnicOption, array('class' => 'form-control')); ?>
        </div>
        <?php //echo $form->error($user,'ethnic_');  ?>
    </div>

    <!--
    <div class="form-group">
    <?php echo $form->labelEx($user, 'religion_', array('class' => 'col-sm-2 control-label')); ?>
        <div class="col-sm-2">
    <?php echo $form->dropDownList($user, 'religion_', $user->religionOption, array('empty' => '', 'class' => 'form-control')); ?>
        </div>
    <?php //echo $form->error($user,'religion_');  ?>
    </div>
    -->

    <hr />

    <div class="form-group">
        <?php echo $form->labelEx($user, 'phoneNumber_', array('class' => 'col-sm-2 control-label')); ?>
        <div class="col-sm-2">
            <?php echo $form->textField($user, 'phoneNumber_', array('class' => 'form-control')); ?>
        </div>
        <?php //echo $form->error($user,'phoneNumber_'); ?>

        <?php echo $form->labelEx($user, 'faxNumber_', array('class' => 'col-sm-2 control-label')); ?>
        <div class="col-sm-2">
            <?php echo $form->textField($user, 'faxNumber_', array('class' => 'form-control')); ?>
        </div>
        <?php //echo $form->error($user,'faxNumber_'); ?>
    </div>

    <div class="form-group">
        <?php echo $form->labelEx($user, 'mobileNumber_', array('class' => 'col-sm-2 control-label')); ?>
        <div class="col-sm-2">
            <?php echo $form->textField($user, 'mobileNumber_', array('class' => 'form-control')); ?>
        </div>
        <?php //echo $form->error($user,'mobileNumber_'); ?>

        <?php echo $form->labelEx($user, 'email_', array('class' => 'col-sm-2 control-label')); ?>
        <div class="col-sm-2">
            <?php echo $form->textField($user, 'email_', array('class' => 'form-control')); ?>
        </div>
        <?php //echo $form->error($user,'email_');  ?>
    </div>


    <hr />

    <div class="form-group">
        <?php echo $form->labelEx($address, 'address_', array('class' => 'col-sm-2 control-label')); ?>
        <div class="col-sm-6">
            <?php echo $form->textField($address, 'address_', array('class' => 'form-control')); ?>
        </div>
        <?php //echo $form->error($address,'address_');  ?>
    </div>

    <!--
    <div class="form-group">
    <?php echo $form->labelEx($address, 'street_', array('class' => 'col-sm-2 control-label')); ?>
        <div class="col-sm-3">
    <?php echo $form->textField($address, 'street_', array('class' => 'form-control')); ?>
        </div>
    <?php //echo $form->error($address,'street_'); ?>
    </div>
    
    <div class="form-group">
    <?php echo $form->labelEx($address, 'district_', array('class' => 'col-sm-2 control-label')); ?>
        <div class="col-sm-2">
    <?php echo $form->textField($address, 'district_', array('class' => 'form-control')); ?>
        </div>
    <?php //echo $form->error($address,'district_');  ?>
    </div>
    -->

    <div class="form-group">
        <?php echo $form->labelEx($address, 'city_', array('class' => 'col-sm-2 control-label')); ?>
        <div class="col-sm-2">
            <?php echo $form->textField($address, 'city_', array('class' => 'form-control')); ?>
        </div>
        <?php //echo $form->error($address,'city_'); ?>

        <?php echo $form->labelEx($address, 'state_', array('class' => 'col-sm-2 control-label')); ?>
        <div class="col-sm-2">
            <?php echo $form->textField($address, 'state_', array('class' => 'form-control')); ?>
        </div>
        <?php //echo $form->error($address,'state_');  ?>    
    </div>

    <!--
    <div class="form-group">
    <?php echo $form->labelEx($address, 'province_', array('class' => 'col-sm-2 control-label')); ?>
        <div class="col-sm-2">
    <?php echo $form->textField($address, 'province_', array('class' => 'form-control')); ?>
        </div>
    <?php //echo $form->error($address,'province_'); ?>
    </div>
    
    <div class="form-group">
    <?php echo $form->labelEx($address, 'typeNumber_', array('class' => 'col-sm-2 control-label')); ?>
        <div class="col-sm-2">
    <?php echo $form->textField($address, 'typeNumber_', array('class' => 'form-control')); ?>
        </div>
    <?php //echo $form->error($address,'typeNumber_'); ?>
    </div>
    
    <div class="form-group">
    <?php echo $form->labelEx($address, 'locality_', array('class' => 'col-sm-2 control-label')); ?>
        <div class="col-sm-2">
    <?php echo $form->textField($address, 'locality_', array('class' => 'form-control')); ?>
        </div>
    <?php //echo $form->error($address,'locality_');  ?>
    </div>
    -->

    <div class="form-group">
        <?php echo $form->labelEx($address, 'postalCode_', array('class' => 'col-sm-2 control-label')); ?>
        <div class="col-sm-2">
            <?php echo $form->textField($address, 'postalCode_', array('class' => 'form-control')); ?>
        </div>
        <?php //echo $form->error($address,'postalCode_'); ?>

        <?php echo $form->labelEx($address, 'country_', array('class' => 'col-sm-2 control-label')); ?>
        <div class="col-sm-2">
            <?php echo $form->dropDownList($address, 'country_', $address->countryOption, array('class' => 'form-control')); ?>
        </div>
        <?php //echo $form->error($address,'country_'); ?>
    </div>

    <div class="form-group">
        <?php echo $form->labelEx($address, 'latitude_', array('class' => 'col-sm-2 control-label')); ?>
        <div class="col-sm-2">
            <?php echo $form->textField($address, 'latitude_', array('class' => 'form-control')); ?>
        </div>
        <?php //echo $form->error($address,'latitude_'); ?>

        <?php echo $form->labelEx($address, 'longitude_', array('class' => 'col-sm-2 control-label')); ?>
        <div class="col-sm-2">
            <?php echo $form->textField($address, 'longitude_', array('class' => 'form-control')); ?>
        </div>
        <?php //echo $form->error($address,'longitude_');  ?>
    </div>


    <hr />

    <?php if ($user->isNewRecord): ?>
        <div class="form-group">
            <?php echo $form->labelEx($user, 'password_', array('class' => 'col-sm-2 control-label')); ?>
            <div class="col-sm-6">
                <div class="form-control-static">
                    <?php echo Lang::t('admin.register.lbl.auto.generate.password.description'); ?>
                </div>
            </div>
        </div>
    <?php endif; ?>

    <div class="form-group">
        <div class="col-sm-offset-2 col-sm-6">
            <button type="submit" class="btn btn-default"><span class="glyphicon glyphicon-floppy-save"></span> <?php echo $user->isNewRecord ? Lang::t('admin.register.btn.submit') : Lang::t('admin.profile.btn.submit'); ?></button>
            <a href="<?php echo $this->homeUrl; ?>" class="btn btn-default"><span class="glyphicon glyphicon-floppy-remove"></span> <?php echo Lang::t('admin.register.btn.cancel'); ?></a>
        </div>
    </div>

    <?php $this->endWidget(); ?>
</div><!--form-->